package test.clone;

public class CloneClass implements Cloneable {

	private String str;
	private int number;
	private TypeClass typeClass;

	@Override
	public CloneClass clone() throws CloneNotSupportedException {
		CloneClass o = (CloneClass) super.clone();
		// 这里需要对应用对象进行一次克隆
		o.typeClass = typeClass.clone();
		return o;
	}

	/**
	 * @return the str
	 */
	public String getStr() {
		return str;
	}

	/**
	 * @param str
	 *            the str to set
	 */
	public void setStr(String str) {
		this.str = str;
	}

	/**
	 * @return the number
	 */
	public int getNumber() {
		return number;
	}

	/**
	 * @param number
	 *            the number to set
	 */
	public void setNumber(int number) {
		this.number = number;
	}

	/**
	 * @return the typeClass
	 */
	public TypeClass getTypeClass() {
		return typeClass;
	}

	/**
	 * @param typeClass
	 *            the typeClass to set
	 */
	public void setTypeClass(TypeClass typeClass) {
		this.typeClass = typeClass;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "CloneClass [str=" + str + ", number=" + number + ", typeClass=" + typeClass + "]";
	}
}
